<!--弹窗-微信-->
<template>
  <div class="bg">
    <div class="all"></div>

    <div class="bg2">
      
      <div class="nav">
        <div class="close"  @click="backClick">
          <LImage class="img-close" :src="Config.img('view_btn_close_black.png')" ></LImage>
        </div>
        <text class="font36 text1">{{T('微信')}}</text>
      </div>

      <div class="acenter">
        <div class="qr-code-box">
          <WeexQRCode class="qr-code" :code="weChatUrl"></WeexQRCode>
        </div>

        <text class="font26 text2">{{T('添加微信进群')}}：{{weChat}}</text>
      </div>

      <div class="height40"></div>
      <div class="btn main-bt1" @click="copyClick">
        <text class="font30 text1">{{T('复制微信号')}}</text>
      </div>

      <div class="height20"></div>
      <div class="btn bt3" @click="saveCodeClick">
        <text class="font30 text1">{{T('保存二维码到相册')}}</text>
      </div>

      <div class="height60"></div>
    </div>
  </div>
</template>

<style src="@/_css/style.css" ></style>
<style scoped>
.bg {
  flex: 1;
  background-color:rgba(0,0,0,0.4);
}
.img-close{
  width:36px;
  height:36px;
}

.nav{
  flex-direction: row;
  justify-content: center;
  align-items: center;
  height:116px;
}
.close {
  position:absolute;
  justify-content: center;
  align-items: center;
  width: 116px;
  height:116px;
  left: 0;
}
.qr-code-box{
  justify-content: center;
  align-items: center;
  background-color:#ffffff;

  width:300px;
  height:300px;
  border-radius: 4px;

  margin-top:60px;
  margin-bottom: 60px;
}
.qr-code{
  width:280px;
  height:280px;
}
.btn {
  justify-content: center;
  align-items: center;
  height:70px;
  border-radius:4px;

  margin-left: 40px;
  margin-right: 40px;
}


/************* 间距 */
.height60 {
  height: 60px;
}
</style>

<script>

import jnavigator from "@/_js/navigator";
import jmodal from "@/_js/modal";
import jconfig from "@/_js/config";

const weexFunction = weex.requireModule("WeexFunction");
const clipboard = weex.requireModule("clipboard");

import I18N from "@/_i18n/i18n";
var T = I18N.t;

export default {
  
  data() {
    return {
      T:T,
      Config:jconfig,
      weChat:"yinggewb", //微信号
      weChatUrl:"https://u.wechat.com/EB9L_rLhk870sQ49lPllT_Y", //微信链接
    };
  },

  created(){
  },

  methods: {

    /********************************** 点击事件*/
    //退出
    backClick(){
      jnavigator.dismiss();
    },

    //复制微信号
    copyClick(){
      clipboard.setString(this.weChat);
      jmodal.toast(T("微信号复制成功"),2);
    },

    //保存二维码图片
    saveCodeClick(){
      weexFunction.saveQrCodePic(this.weChatUrl,()=>{});
      jmodal.toast(T("二维码图片已保存到相册中"),2);
    },
  }
};


</script>
